<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <button @click="clearContent">清空</button>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  props: {
    msg: String
  },
  methods: {
    clearContent() {
      this.$emit('clearInput');
    }
  }
}
</script>

<style scoped>
.hello {
  text-align: center;
}

.content-box {
  padding: 10px;
  margin-top: 10px;
  position: relative;
}

.content-box p {
  margin: 0;
}

.content-box button {
  position: absolute;
  top: 5px;
  right: 5px;
}

h3 {
  margin: 40px 0 0;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  display: inline-block;
  margin: 0 10px;
}

a {
  color: #42b983;
}
</style>
